Skip to main content
Version: 3.2.0

Facial Recognition

POST

  https://api.apptenticate.com/api/v3.2/biometrics/recognizer/face/


Authentication

Use your JWT obtained from the authentication process to make requests to this endpoint.

The response will be 401 unauthorized if the JWT is expired. In this case you will have to obtain a new JWT.


This operation allows you to recognize a Person according to the image and the citizen_id of the request.

** NOTE **

• The response may be 401 unauthorized if the JWT token must be refreshed.

• The image sent in jpg, png or base64 format must not exceed 2MB.

• The image (image) can be sent as a .jpg/.png file or as a base64 string, for example: "data:image/jpg;base64,<base64_content>".

Request structure - method: POST

Ruta: api/v2/biometrics/recognizer/face/

Payload para request base:

Payload: {
'citizen_id': Citizen ID,
'image': Selfie image
} // (Where images are .jpg, .png files or base64 strings)

Payload with image in base64:

Payload: {
'citizen_id': Citizen ID,
'image': 'data:image/jpg;base64,<base64_content>',
}

Examples of requests

Python

#JWTToken
header = { 'Authorization': 'Bearer {}'.format(token) }

# Payload for base request
data = {'citizen_id': '1234'}
files=[
('image',(unknow.jpeg',open('/D:/unknow.jpeg','rb'),'image/jpeg'))
]
# Where images are .jpg or .png files or base64 strings


# Send request
response = requests.post(
apptenticate_url,
data=data,
files=files,
headers=header
)
response = json.loads(response.content)

# Payload with image in base64
data = {
'citizen_id': '1234',
'image': 'data:image/jpg;base64,<base64_content>',
}
response = requests.post(
apptenticate_url,
data=data,
headers=header
)
response = json.loads(response.content)

Response structure

Response format: JSON

Base response (True):

Answer: {
"id": "e80d4738-adc3-833f715d655c",
"created_at": "2022-09-30T13:22:43.086385Z",
"result": true,
"result_text": "Recognised face",
"name": "Will Smith",
"citizen_id": "1234"

}

Base response (False):

Answer: {
"id": "f78d463u-9876-3356-223a-84s4f7as5d655c",
"created_at": "2022-09-30T13:23:40.922403Z",
"result": false,
"result_text": "Face does not match ID"

}

Rejection Codes

CodigoMensaje
200Query completed correctly.
500An error occurred obtaining catalog.
400The request is poorly formulated.
404Person not found.